﻿using System;
using Colorful.Furniture.Enum;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.View;

/// <summary>
/// 产品关联信息视图
/// </summary>
[Table(Name = "view_inventory", DisableSyncStructure = true)]
public class ViewInventory
    {
    /// <summary>
    /// 订单编码
    /// </summary>
    [Column(Name = "id", IsPrimary = true)]
    public Guid Id { get; set; }

    /// <summary>
    ///  供应商编码
    /// </summary>
    [Column(Name = "supplier_id")]
    public Guid? SupplierId { get; set; }

    /// <summary>
    ///  供应商编号
    /// </summary>
    [Column(Name = "supplier_code", StringLength = 20)]
    public int? SupplierCode { get; set; }

    /// <summary>
    ///  供应商名称
    /// </summary>
    [Column(Name = "supplier_name", StringLength = 150)]
    public string SupplierName { get; set; }

    /// <summary>
    ///  供应商产品编号
    /// </summary>
    [Column(Name = "supplier_product_no", StringLength = 150)]
    public string SupplierProductNo { get; set; }

    /// <summary>
    ///  供应商产品名称
    /// </summary>
    [Column(Name = "supplier_product_name", StringLength = 150)]
    public string SupplierProductName { get; set; }

    /// <summary>
    ///  供应商结算价
    /// </summary>
    [Column(Name = "cost_price", Scale = 4, Precision = 14)]
    public decimal? CostPrice { get; set; }

    /// <summary>
    ///  换算比例：1个客户订单数量 = * 个供应商订单数量 
    /// </summary>
    [Column(Name = "supplier_qty")]
    public int? SupplierQty { get; set; }

    /// <summary>
    ///  下游最大提交数量
    /// </summary>
    [Column(Name = "max_qty")]
    public int? MaxQty { get; set; }

    /// <summary>
    ///  下游最小提交数量
    /// </summary>
    [Column(Name = "min_qty")]
    public int? MinQty { get; set; }

    /// <summary>
    ///  是否启用：1 = 是；0 = 否；
    /// </summary>
    [Column(Name = "is_enable")]
    public int? IsEnable { get; set; }

    /// <summary>
    ///  上游商户编号
    /// </summary>
    [Column(Name = "merchant_code", StringLength = 100)]
    public string MerchantCode { get; set; }

    /// <summary>
    ///  产品Id
    /// </summary>
    [Column(Name = "product_id")]
    public Guid? ProductId { get; set; }

    /// <summary>
    ///   产品名字
    /// </summary>
    [Column(Name = "product_name", StringLength = 50)]
    public string ProductName { get; set; }

    /// <summary>
    ///  产品编号 
    /// </summary>
    [Column(Name = "product_no", StringLength = 12)]
    public string ProductNo { get; set; }

    /// <summary>
    ///  面额
    /// </summary>
    [Column(Name = "face_remark", StringLength = 40)]
    public string FaceRemark { get; set; }

    /// <summary>
    /// 面值
    /// </summary>
    [Column(Name = "face_amount", Scale = 2, Precision = 8)]
    public decimal? FaceAmount { get; set; }

    /// <summary>
    ///  状态（0 = 禁用，1 = 启用，2 = 下架，3 = 上架）
    /// </summary>
    [Column(Name = "status")]
    public int? Status { get; set; }

    /// <summary>
    ///  产品类型
    /// </summary>
    [Column(Name = "product_type")]
    public ProductType? ProductType { get; set; }

    /// <summary>
    ///  排序字段：值越大越靠前
    /// </summary>
    [Column(Name = "sort")]
    public int? Sort { get; set; }

    /// <summary>
    ///  产品对应供应商添加时间
    /// </summary>
    [Column(Name = "product_add_time", CanUpdate = false, Position = -89)]
    public DateTime ProductAddTime { get; set; }

    /// <summary>
    ///  售价
    /// </summary>
    [Column(Name = "sale_price", Scale = 4, Precision = 14)]
    public decimal? SalePrice { get; set; }

    /// <summary>
    ///  手续比例（店铺售卖金额 - 系统产品对应客户的售卖金额）
    /// </summary>
    [Column(Name = "commission", Scale = 4, Precision = 12)]
    public decimal? Commission { get; set; }

    /// <summary>
    ///  客户编码
    /// </summary>
    [Column(Name = "customer_id")]
    public Guid? CustomerId { get; set; }

    /// <summary>
    /// 客户编号
    /// </summary>
    [Column(Name = "customer_code")]
    public int? CustomerCode { get; set; }

    /// <summary>
    /// 客户名称
    /// </summary>
    [Column(Name = "customer_name", StringLength = 50)]
    public string CustomerName { get; set; }
    
    /// <summary>
    ///  是否验证邮箱：1 = 是；0 = 否；
    /// </summary>
    [Column(Name = "is_check_email")]
    public int? IsCheckEmail { get; set; }

}

